<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>
	<head>
		<%@ include file="/commons/css_js_head.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title> 修改菜单</title>
<script type="text/javascript">
//复写Url
doUpdateUrl = "${ctx }/permission/efMenuAction!doUpdate.ts";
doReturnUrl = "${ctx }/permission/efMenuAction!doList.ts";
doAddBeforeUrl = "${ctx}/permission/efMenuAction!doFindById.ts";
doDelUrl = "${ctx}/permission/efMenuAction!doDelete.ts";


//更新
function doUpdate() {
	var _form = document.forms[0];
	if (doUpdateUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	
	_form.action = doUpdateUrl;
}

//添加之前 
function doAddBefore(parentMenuId) {
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doAddBeforeUrl+"?parentMenuId="+parentMenuId;
	_form.submit();
}

//校验数据
$(document).ready(function(){
	
	$.formValidator.initConfig({formid:"form1",alertmessage:true,onerror:function(msg){alert(msg)},onsuccess:function(){doUpdate();}});
	
	$("#_efMenu_menuName").formValidator().inputValidator({min:1,max:32,onerror:"请输入菜单名称，且只能在1-32个汉字之间"});
	$("#_efMenu_menuUrl").formValidator().inputValidator({min:1,max:256,onerror:"请输入菜单URL，且只能在1-256个字符之间"});
	$("#_efMenu_menuPhotoUrl").formValidator().inputValidator({max:256,onerror:"菜单图片URL最多只能256个字符"});
	$("#_efMenu_displayNo").formValidator().inputValidator({min:1,max:3,onerror:"请输入菜单显示顺序，且只能在1-999之间"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"格式不正确"});
});

</script>
</head>
<body style="overflow-y:auto;overflow-x:hidden">

 <s:form action="/permission/efMenuAction" id="form1" onsubmit="reutrn doUpdate();" method="post" theme="simple">	
 <s:hidden name="efMenu.menuId"></s:hidden>
 
<div class="mTitle">
  <b class="bbig">修改菜单</b>
  带<b class="fred"> * </b>号为必填项
</div>

<!--list -->
<div class="mainAdd">
<table class="addTable">
	<tr>
		<th width="10%">
			<b class="fred">*</b>上级菜单：
		</th>
		<td width="40%">
			<s:textfield name="efMenu.parentMenuId" theme="simple" cssStyle="background:#ECEEEC" readonly="true" size="50"></s:textfield>
		</td>
	</tr>
	<tr>
		<th width="10%">
			<b class="fred">*</b>菜单名称：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_menuName" name="efMenu.menuName" theme="simple" maxlength="32" size="50"></s:textfield>
		</td>
	</tr>
	<tr>
		<th width="10%">
			<b class="fred">*</b>菜单URL：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_menuUrl" name="efMenu.menuUrl" theme="simple" maxlength="256" size="50"></s:textfield>
		</td>
	</tr>
	<tr>
		<th width="10%">
			菜单图片：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_menuPhotoUrl" name="efMenu.menuPhotoUrl" theme="simple" maxlength="256" size="50"></s:textfield>
		</td>
	</tr>
	<tr>
		<th width="10%">
			<b class="fred">*</b>菜单显示顺序：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_displayNo" name="efMenu.displayNo" theme="simple" maxlength="3" size="50"></s:textfield>
		</td>
	</tr>
	<tr>
		<th width="10%">
			菜单类型：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_linkType" name="efMenu.linkType" theme="simple" maxlength="64"
				size="50"></s:textfield>
				<span class="icon_help">&nbsp;</span>如果是弹出式窗口就输入thickbox，其它则为空。
		</td>
	</tr>
	<tr>
		<th width="10%">
			目标：
		</th>
		<td width="40%">
			<s:textfield id="_efMenu_target" name="efMenu.target" theme="simple" maxlength="64"
				size="50"></s:textfield>
				<span class="icon_help">&nbsp;</span>输入显示页面的窗口名称
		</td>
	</tr>	
	<tr>
		<th width="10%">
			<b class="fred">*</b>菜单状态：
		</th>
		<td width="40%">
			<select name="efMenu.dicMenuIsValid" >
		    	<ef:option groupname="DicRoleIsValid" selectedValue="${efMenu.dicMenuIsValid}" link="true"></ef:option>
		    </select>
		</td>
	</tr>

				 
</table>
</div>
<!--end list -->

<div class="addToolbar">
	<p>
		<input class="btn" name="btn_confirm" value="确定" type="submit" />
		<input class="btn" name="btn_confirm" value="增加子菜单" type="button" onclick="doAddBefore('${efMenu.menuId}')" />
	</p>
</div>

</s:form>

<script>
//刷新左边的菜单树
refreshFrame("left");
</script>

</body>
</html>
